10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I have a question regarding text substitution.
I have a file that contains a lot of text.
Some of the text is separated with a \n like:
TEST\nTEST2\nTEST3
BLA\nBLA2\nBLA3
So there are both actual newlines and 'used to be newlines' in the text.
using tr
tr "\n" ","
or... (5 Replies)
Discussion started by: JaapSchuurman
5 Replies
2. UNIX for Dummies Questions & Answers
Hi Everybody! First post! Totally noobie.
I'm using the terminal to read a poorly formatted book.
The text file contains, in the middle of paragraphs, hyphenation to split words that are supposed to be on multiple pages. It looks ve -- ry much like this.
I was hoping to use grep -v " -- "... (5 Replies)
Discussion started by: AxeHandle
5 Replies
3. Shell Programming and Scripting
I was testing some and from this string try to remove all ", but not \"
cat file
The quick brown fox "jumps", over the 'lazy \"dog\"'
result requested: The quick brown fox jumps, over the 'lazy \"dog\"'
I have seen a working solution for sed, but I like awk :)
This code seem to work,... (19 Replies)
Discussion started by: Jotne
19 Replies
4. Shell Programming and Scripting
How do I remove line that do not contain text, but that do contain tabs?
I have tried the command
cat file | awk NF
but that doesn't work when the lines contain tabs (and spaces).
I have also tried:
cat file | sed '/^$/d' (9 Replies)
Discussion started by: locoroco
9 Replies
5. Shell Programming and Scripting
Hi all,
I wrote the following code to remove the value which are 0 in the input file (a columns if numbers).
awk 'BEGIN {
for (i=1; i<=NF; i++)
if ($i)
printf("%13.6e\n",$i)
}' $1 >> $2
The script works if the zeros are written as
0.0000
but not as
0.000000e+00
In... (10 Replies)
Discussion started by: f_o_555
10 Replies
6. Shell Programming and Scripting
Hey everyone, I kinda new to shell programming and learning bits and pieces of stuff from tutorials.
I got this problem, where I asked my user to enter a string, which will delete a specific line in the string, which I'm unable to do it.
Text file(BookDB.txt) as shown:
Three Little... (4 Replies)
Discussion started by: aLHaNz
4 Replies
7. Shell Programming and Scripting
Hi everyone,
I need to replace the text between two strings (html tags) and I'm having trouble figuring out how to do so. I can display the text with sed but I'm not having any luck deleting the text between the two strings.
My file looks like this:
<oths>test</oths><div class="text">1928... (2 Replies)
Discussion started by: cg2
2 Replies
8. Shell Programming and Scripting
Hello Everyone! Of course I am rather new to these forums, but I have been browsing the forums for awhile, always has a lot of useful information :)
This time however, I can not find the information I need, well, not completely. So here is the problem, I am a linux admin (dealing mostly with... (1 Reply)
Discussion started by: Rhije
1 Replies
9. Shell Programming and Scripting
Here is my problem I'm hoping you guru's can help me figure out. I have a text file that contains comma delimited columns. What I'm looking to do is see if the 24th column on each row in the file contains a value (not null), and then write/append that line to a different file.
I've been... (4 Replies)
Discussion started by: WABonnett
4 Replies
10. UNIX for Dummies Questions & Answers
Dear all
I have a file which looks like this
xxxxxxxxxxxxxx,xxx,xxxxxxxxxx
xxxxxxxxxxxxxx,xxx,xxxxxxxxxx
etc
basically 14 characters then a comma, three characters, then a comma then 10 characters. We are uploading this file to our mainframe and they want the commas removed, so it... (6 Replies)
Discussion started by: hcclnoodles
6 Replies