•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,423 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,615 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 708 | Replies: 2
![]() |
•
•
Join Date: Mar 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I'm still new to linux, and im looking for some helpful ideas.
What I'm trying to do is I need to write a script that will take a text file, which has paragraphs and create another text file which extracts every individual word from that orignal text file and lists them line by line..
example:
text file 1:
hello. this is a test example file! i hope i could get some great ideas...
new text file2:
hello
this
is
a
test
example
file
i
...
and so on...
Any ideas on i how i might go about accomplishing this?
thanks!
I'm still new to linux, and im looking for some helpful ideas.
What I'm trying to do is I need to write a script that will take a text file, which has paragraphs and create another text file which extracts every individual word from that orignal text file and lists them line by line..
example:
text file 1:
hello. this is a test example file! i hope i could get some great ideas...
new text file2:
hello
this
is
a
test
example
file
i
...
and so on...
Any ideas on i how i might go about accomplishing this?
thanks!
•
•
Join Date: May 2006
Location: Bellevue, WA
Posts: 1,548
Reputation:
Rep Power: 8
Solved Threads: 51
without removing duplicates, you could just replace any spaces with a newline:
This won't remove punctuation, but you could write another one to do that.
*code not tested, but pretty sure it'll do the trick
sed "s/ /\n/g" originalFile > outputFile
*code not tested, but pretty sure it'll do the trick
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Body Text lost when sending hotmail (Web Browsers)
- edit text on a gif image in photoshop (Graphics and Multimedia)
- capturing text (C)
- i = system ("cd c:\text"); :( (C)
- Using string variables in a label or text box? (VB.NET)
- connect to text file database (Visual Basic 4 / 5 / 6)
Other Threads in the Shell Scripting Forum
- Previous Thread: script that checks whether a file system is full
- Next Thread: samba server error



Linear Mode