06-08-2009
How to add 'n' of tab char?
Hi All,
I need to add 'n' no. of tab char (\t) in a file thro' a script. Say for example if I give 5 as input then my script should give the all the lines with 5tabs.
Input File :
#######
12323234
56465456
asdfdf456
dfgdf4564
So my Output File should look like:
#######################
\t\t\t\t\t12323234
\t\t\t\t\t56465456
\t\t\t\t\tasdfdf456
\t\t\t\t\tdfgdf4564
Thanks in advance
Saravana
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to added a TAB at end of each line of a file using ksh vi (1 Reply)
Discussion started by: ravi.sadani19
1 Replies
2. UNIX for Dummies Questions & Answers
I'm trying to run a script which will ssh to several other servers (All Solaris 10) and execute a sar -f command to get each server's CPU usage for a given hour.
It kinda works OK but I just can't figure out how to separate the returned fields with a Tab character. I've done lots of searching... (2 Replies)
Discussion started by: jake657
2 Replies
3. UNIX for Advanced & Expert Users
I tried to readout the forth word of a file and add a ',' after each occurance and write the result in a file, but following code doesn't work
cat output.csv | cut -d ';' -f4 || ', '>> NR.txt (2 Replies)
Discussion started by: ABE2202
2 Replies
4. Programming
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies
5. UNIX Desktop Questions & Answers
hey ,
i want to check if the char "#" exist at the end of every line of txt file
and if it dosent then add it for example:
the cat jumped on my mom #
cars can run on water#
i cant get a date
blue
yellow#
will be:
the cat went back home#
cars can run on water#
i cant get a... (2 Replies)
Discussion started by: boaz733
2 Replies
6. Shell Programming and Scripting
I'm trying to add a '1' before a line that has the word "C_ID"
s/.*C_ID.*/&\n1/
The above code did what I need, but the '1' is added after the C_ID word :( Help please. (5 Replies)
Discussion started by: newbeee
5 Replies
7. Shell Programming and Scripting
Hello experts,
I need to convert one file into readable format.
Input file is like following line.
STG,12345,000,999,' PQR, 2345,000,999,' XYZ,7890,000,999,
Output should be following (After ' char new line char should be added.)
STG,12345,000,999,'
PQR, 2345,000,999,' ... (16 Replies)
Discussion started by: meetmedude
16 Replies
8. Shell Programming and Scripting
Hi All,
I woulk like thanks to all of you for your instant support. I am again in a trouble so move to here for solution. I want to add a new sheet or a new tab in a csv file means a singly csv file having two or more sheets. Please help me any help towards this should highly be appreciated.
... (3 Replies)
Discussion started by: Ashish Singhal
3 Replies
9. Shell Programming and Scripting
In the below awk written by @RavinderSingh13 I have added a few lines and am trying to have the output be tab-delimited. The input is space-delimeted and the portion in bold seems to add a tab to the Not found but not the found. Thank you :).
file1
One 1
Two 2
Three 3
file2
One 1... (2 Replies)
Discussion started by: cmccabe
2 Replies
10. Shell Programming and Scripting
Need to add a numeric & special char to end of the first line
Existing file:
12-11-16|11 2016 Jan 12:34:55|03:55|
13-10-16|10 2016 Jan 12:34:55|03:55|12-11-16|11 2016 Jan 12:34:55|03:55|
14-10-16|19 2016 Jan 12:34:55|03:55|13-11-16|11 2016 Jan 12:34:55|04:55|
15-10-16|18 2016 Jan... (11 Replies)
Discussion started by: Joselouis
11 Replies
DIFF3(1) User Commands DIFF3(1)
NAME
diff3 - compare three files line by line
SYNOPSIS
diff3 [OPTION]... MYFILE OLDFILE YOURFILE
DESCRIPTION
Compare three files line by line.
-e --ed
Output unmerged changes from OLDFILE to YOURFILE into MYFILE.
-E --show-overlap
Output unmerged changes, bracketing conflicts.
-A --show-all
Output all changes, bracketing conflicts.
-x --overlap-only
Output overlapping changes.
-X Output overlapping changes, bracketing them.
-3 --easy-only
Output unmerged nonoverlapping changes.
-m --merge
Output merged file instead of ed script (default -A).
-L LABEL --label=LABEL
Use LABEL instead of file name.
-i Append `w' and `q' commands to ed scripts.
-a --text
Treat all files as text.
-T --initial-tab
Make tabs line up by prepending a tab.
--diff-program=PROGRAM
Use PROGRAM to compare files.
-v --version
Output version info.
--help Output this help.
If a FILE is `-', read standard input.
AUTHOR
Written by Randy Smith.
REPORTING BUGS
Report bugs to <bug-gnu-utils@gnu.org>.
COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the
GNU General Public License. For more information about these matters, see the file named COPYING.
SEE ALSO
The full documentation for diff3 is maintained as a Texinfo manual. If the info and diff3 programs are properly installed at your site,
the command
info diff
should give you access to the complete manual.
diffutils 2.8.1 April 2002 DIFF3(1)