[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

need to remove '\n\t' from file and keep rest

i am working on a txt file. I need to remove '\n\t' (newline+tab) that is appearing in some of the lines. Tried awk and sed but cant seem to get those utilities to work. If i do an:
od -c <filename> i can see the '\n \t' characters.
i do have other newline chars '\n' that i want to keep. only wnat to get rid of back to back chars like i said above  
0
pdadddino
Asked:
pdadddino
1 Solution
 
pdadddinoAuthor Commented:
tried
sed 's/\\n\\t//g' inputfile> outputfile

does not do anything
0
 
TintinCommented:
It's impossible to have a \n\t combination on the same line.  What you will be seeing is a \t\n, but don't forget that od -c will wrap lines, so if you have a line with just a \t\n, the sequence you see with od -c will be \n\t\n, where the first \n is from the previous line.

Are you wanting to get rid of the lines with no text, eg: \t\n?

If so, do

sed '/[TAB]/D' file

where [TAB] is Ctrl-V Tab



0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now