Hello Dears,
I have hundereds of text
files and every file have thousand of
lines and there is only one word at each
line. My problem is that I want to add a
word with every word in files.
Example:
files contains a words
hello
dani
google
yahoo
Now I want to add a word with every word
like that:
hellodear
daniweb
googleisbest
yahoodotherest
if your understad my problem plz reply me
how can I edit all of my files bcoz
manually editing will take very long
times, bcoz there is about millions words
in all files.
Thanks in Advance.
coolvision 0
Light Poster
Recommended Answers
Jump to PostYour example is too vague.
But you would need to write a program to do that. Give a better example and I could write it for you. (Maybe)
Jump to PostHow is it supposed to know which word to add?
Does it always add the same word when it finds a particular word? Or is the same word always added in the same place in the file?
Are the words to be added add in a list?
…
Jump to PostJust make sure you unzip it first.
Right click on the folder and choose to unzip(extract folder)
Jump to Postif all you need is to add a specific word to the end of each line (which contains one word ), then a batch file will suffice. An example
@echo off for /F %%i in (file.txt) do echo %%iweb
This will add the word "web" to the current lines
…
Jump to PostYeah I just realised.
Why would you need to change the syntax for the bat file tho?
Isn't a batch (bat) file just a mirror of syntax you would use at the command prompt?
I did not change the syntax. Its how variables are defined in Windows batch shell.
If …
All 22 Replies
iamthwee
coolvision 0
Light Poster
MidiMagic 579
Nearly a Senior Poster
coolvision 0
Light Poster
iamthwee
ghostdog74 57
Junior Poster
iamthwee
iamthwee
ghostdog74 57
Junior Poster
iamthwee
ghostdog74 57
Junior Poster
coolvision 0
Light Poster
iamthwee
coolvision 0
Light Poster
iamthwee
iamthwee
coolvision 0
Light Poster
iamthwee
coolvision 0
Light Poster
iamthwee
iamthwee
MidiMagic 579
Nearly a Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.