파일 이름에 따라 폴더의 여러 텍스트 파일에서 특정 줄을 인쇄하려고합니다. 밑줄로 구분 된 3 단어로 명명 된 다음 텍스트 파일을 고려하십시오.여러 텍스트 파일에서 특정 줄을 추출합니다.
Small_Apple_Red.txt
Small_Orange_Yellow.txt
Large_Apple_Green.txt
Large_Orange_Green.txt
어떻게 다음과 같이 달성 할 수 있습니까?
if (first word of file name is "Small") {
// Print row 3 column 2 of the file (space delimited);
}
if (second word of file name is "Orange") {
// print row 1 column 4 of the file;
}
awk에서도 가능합니까?
Perl 용입니까? – amatek
@amatek 예. 이것은 perl을위한 것이다. – mkHun