Searching filename in a textfile - filenames

I need to search through a text file and find filenames and folders. If a filename is found, display a text and if a folder is found, display another text.
can anyone suggest how to do it?
cat filenames.txt | while read line
do
echo $line
done

Related

convert pdf to txt file where bold text placement is changed position

given this pdf
is there a way to process it to a txt file with the following specfications:
the bold answer to print as the 3rd one
to remove empty line between question 1 and 2.
bold answer would have different placement every time as there a lot of questions

How to append one text file to another text file

I need to append 1 text file to another text file.
I've done several keyword searches, and keep coming up with instructions on adding text to an existing file ... which is not the same as appending one text file to another text file.
In a well-designed language, it might look something like the line below, with the contents of source2 added to source1.
Append(path/source1, path/source2, ResultCode)

VBA Macros to open Multiple file path store in one cell

Could anyone help me with a macro that can open nultiple file path store in one cell
File path are stored in Column H and I
H1 can have file file path or multiple and same for I
For Example, if 1 file path is found, it will return as below
1,C:\Users\XXXX\Desktop\work\287497196_DN.pdf
And if 2 file path are stored, separted by a comma
2,C:\Users\XXXX\Desktop\work\Order_9250_TA_0580484707_Copy_of_del._note_XXX_signed_by_cust..TIF,C:\Users\XXXX\Desktop\work\Order_9250_TA_580484707_Customer_e-Mail.EML
The numbers in the start indicates the number of files found in a cell with file path
The files can be PDF, .TIf or .EML
Please help me how can I open all file if I click on that particular cell
Would be really helpful
Not have much time to write complete code, but try using something like:
newArray() = Split(Range("H1"), ",")
For i = 1 to Ubound(newArray)
Documents.Open newArray(i)
next i
So this will split your text with file paths using comma delimiter into an array.
After that you'll loop through array (note that 1st array element is zero, so that your loop starts from 2nd element)

Vb.net read file by line and print lines which contain a specific string

How would I print out every line from a text file that contains a specific string? I have tried something but that didn't work. Thanks in advance...

Not completed file reading

I'm trying to print the number of rows in my file training.txt but found out that my code does not read the whole file. Code goes like this:
row = 1
for line in io.lines 'training.txt' do
row = row + 1
end
print(row)
I tried changing the file with test.txt that has the same format with training.txt and file reading worked fine, reads until the end of file. So maybe the problem is with my text file? But how? It has the same format.
Text files are uploaded here for testing.
The file you uploaded training.txt is not the same format as test.txt, it does not have newline characters that indicate the EOL (End of Line). Try opening it in notepad to see the difference.