[NTLUG:Discuss] bash question

Fred James fredjame at concentric.net
Wed Sep 12 12:58:36 CDT 2001


209 files? -OK, do this in steps:
(1) use this command (or something like it) to create a file containing 
all of the filenames you care about, in list form:
ls -1 *.pdf > filelist
(BTW, that is a numeral one for the option)
(2) Edit filelist:
     (a) This is just to look at the content to be sure you don't have 
any extra stuff, and to be familiar with the content.
(3) Now you need to add:
     (a) The mv command, a space, and an apostrophe (sometimes called a 
single quote), to the beginning of each line, and
     (b) An apostrophe, a space, and the appropriate new file name, to 
the end of each line.
     (c) Example of completed line:
mv 'file name one.pdf' file_name_one.txt
(4) Make the file executable, and run it.

Choices for step three include, (a) do it in vi, (b) do it with sed, or 
(c) do it with awk (or nawk) - which do you like?


George Lass wrote:

> On newer versions of RedHat (7.1 anyway) you can also escape the
> space(s):
> 
> "file name with spaces.pdf"
> 
> file\ name\ with\ spaces.pdf
> 
> George
> 
> 
> "Wrenn, Bobby J." wrote:
> 
>>If I can get an answer to this I will finally be able to use Linux at work.
>>
>>I need to take 209 pdf files with spaces in the file names. and convert them
>>into text. I am very new to scripting and know nothing about regular
>>expressions. Is there an easy way to remove the spaces from the file names?
>>Then how do I recursively submit the files to pdftotext with the same name
>>except for the .pdf changed to .txt?
>>
>>Just getting that much done will be a big help. The next step may be
>>trickier. I need to extract a name, address, and equipment list from each of
>>the files and get it into some kind of database where I can query for total
>>by item or item by location.
>>
>>I'm a database beginner but a quick learner. TIA for any help. Please
>>contact me directly if this is not appropriate for the list.
>>
>>TIA
>>Bobby Wrenn
>>Sr. Service Planner
>>BancTec, Inc.
>>972.450.7832
>>
>>_______________________________________________
>>http://www.ntlug.org/mailman/listinfo/discuss
>>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
> 
> 
> 


-- 
...make every program a filter...




More information about the Discuss mailing list