Append numbers to a word list? cat...
If I do:
for i in $(cat names); do seq -f "$i%03.0f" 0 999; done > output5.txt I got ( tail snipped): 997munt 998munt 999munt If I do: for i in $(cat names); do seq -f "%03.0f$i" 0 999; done > output4.txt I got: 997Zygmunt 998Zygmunt 999Zygmunt How I can get numbers from 000 to 999 appended like: Zygmunt997 Zygmunt998 Zygmunt999 |
Where did the "Zyg"s come from in the second example?
|
Correct word on the list is with "Zyg" Zygmunt etc... I wonder more where the Zyg disapperead & why the number did not come behind?
|
Or is it the list which makes problems?
A'Leshia Aarika Aaron Abas Adrian Belew Adriana Adrianna Zvi Zvonko Zygmunt |
Works for me:
Code:
$ cat names |
There has to be something strange on my Shell? Ubuntu Lucid...
|
The names file could contain carriage return characters if it was made in Windows.
\n is the end of line code for Linux \r\n is the end of line code for Windows \n represents a newline character \r represents a carriage return character Code:
# $'\r' gives a carriage return character in bash |
Thanks! It was the carriage return. I did: tr -d '\r' < names.txt > newNames.txt
|
Please mark as SOLVED once you have a solution :)
|
All times are GMT -5. The time now is 01:12 AM. |