With a VERY sloppy interpretation of "along these lines" you might come close to the desired result, once you corrected the syntax / redirection error in the before-last line, and accepted the higher resource cost as you run the script multiple times.
Why not sth. along THIS line :
I have a tab-Delimited file:
Eg:
'test' file contains:
a<tab>b<tab>c<tab>....
Based on certain condition, I wanna increase the number of lines of this file.How do I do that
Eg:
If some value in the database is 1 then one line in 'test' file is fine..
If some value in the database is 2... (1 Reply)
I have a folder that contains say 50 files in a sequential order:
cdf_1.txt
cdf_2.txt
cdf_3.txt
cdf_3.txt
.
.
.
cdf_50.txt.
I need to merge these files in the same order into a single tab delimited file.
I used the following shell script:
for x in {1..50};
do cat cdf_${x}.txt >>... (3 Replies)
Hi Forum
I have a tab delimited file that opens well in Openoffice calc (excel). But when I perform any operation in command line, it reads the file incorrectly. When I 'save As' the same file in office as tab delimited then it works fine.
The file that I think is tab delimited is actually... (8 Replies)
Hi Forum.
I'm struggling to find a solution for the following issue.
I have multiple files a1.txt, a2.txt, a3.txt, etc. and I would like to insert a tab-delimited header record at the beginning of each of the files.
This is my code so far but it's not working as expected.
for i in... (2 Replies)
Here's a sample of the data:
NAME BIRTHDAY SEX LOCATION AGE ID
Jim 05/11/1986 M Japan 27 86
Rei 08/25/1990 F Korea 24 33
Jane 02/24/1985 F India 29 78
I've been trying to sort files using the... (8 Replies)
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Hello,
I have 40 data files where the first three columns are the same (in theory) and the 4th column is different. Here is an example of three files,
file 2: A_f0_r179_pred.txt
Id Group Name E0
1 V N(,)'1 0.2904
2 V N(,)'2 0.3180
3 V N(,)'3 0.3277
4 V N(,)'4 0.3675
5 V N(,)'5 0.3456
... (8 Replies)
Please know that I am very new to unix and trying to learn 'on the job'. I'm only manipulating large tab-delimited files (millions of rows), but I'm stuck and don't know how to proceed with the following. Hoping for some friendly advice :)
I have 2 tab-delimited files - with differing column &... (10 Replies)
Hello Everyone..
I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files
FileP.txt
... (2 Replies)
Discussion started by: YogeshG
2 Replies
LEARN ABOUT REDHAT
pr
PR(1) FSF PR(1)NAME
pr - convert text files for printing
SYNOPSIS
pr [OPTION]... [FILE]...
DESCRIPTION
Paginate or columnate FILE(s) for printing.
Mandatory arguments to long options are mandatory for short options too.
+FIRST_PAGE[:LAST_PAGE], --pages=FIRST_PAGE[:LAST_PAGE]
begin [stop] printing with page FIRST_[LAST_]PAGE
-COLUMN, --columns=COLUMN
output COLUMN columns and print columns down, unless -a is used. Balance number of lines in the columns on each page.
-a, --across
print columns across rather than down, used together with -COLUMN
-c, --show-control-chars
use hat notation (^G) and octal backslash notation
-d, --double-space
double space the output
-D, --date-format=FORMAT
use FORMAT for the header date
-e[CHAR[WIDTH]], --expand-tabs[=CHAR[WIDTH]]
expand input CHARs (TABs) to tab WIDTH (8)
-F, -f, --form-feed
use form feeds instead of newlines to separate pages (by a 3-line page header with -F or a 5-line header and trailer without -F)
-h HEADER, --header=HEADER
use a centered HEADER instead of filename in page header, -h "" prints a blank line, don't use -h""
-i[CHAR[WIDTH]], --output-tabs[=CHAR[WIDTH]]
replace spaces with CHARs (TABs) to tab WIDTH (8)
-J, --join-lines
merge full lines, turns off -W line truncation, no column alignment, --sep-string[=STRING] sets separators
-l PAGE_LENGTH, --length=PAGE_LENGTH
set the page length to PAGE_LENGTH (66) lines (default number of lines of text 56, and with -F 63)
-m, --merge
print all files in parallel, one in each column, truncate lines, but join lines of full length with -J
-n[SEP[DIGITS]], --number-lines[=SEP[DIGITS]]
number lines, use DIGITS (5) digits, then SEP (TAB), default counting starts with 1st line of input file
-N NUMBER, --first-line-number=NUMBER
start counting with NUMBER at 1st line of first page printed (see +FIRST_PAGE)
-o MARGIN, --indent=MARGIN
offset each line with MARGIN (zero) spaces, do not affect -w or -W, MARGIN will be added to PAGE_WIDTH
-r, --no-file-warnings
omit warning when a file cannot be opened
-s[CHAR],--separator[=CHAR]
separate columns by a single character, default for CHAR is the <TAB> character without -w and 'no char' with -w -s[CHAR] turns off
line truncation of all 3 column options (-COLUMN|-a -COLUMN|-m) except -w is set
-SSTRING, --sep-string[=STRING]
separate columns by STRING, without -S: Default separator <TAB> with -J and <space> otherwise (same as -S" "), no effect on column
options
-t, --omit-header omit page headers and trailers
-T, --omit-pagination
omit page headers and trailers, eliminate any pagination by form feeds set in input files
-v, --show-nonprinting
use octal backslash notation
-w PAGE_WIDTH, --width=PAGE_WIDTH
set page width to PAGE_WIDTH (72) characters for multiple text-column output only, -s[char] turns off (72)
-W PAGE_WIDTH, --page-width=PAGE_WIDTH
set page width to PAGE_WIDTH (72) characters always, truncate lines, except -J option is set, no interference with -S or -s
--help display this help and exit
--version
output version information and exit
-T implied by -l nn when nn <= 10 or <= 3 with -F. With no FILE, or when FILE is -, read standard input.
AUTHOR
Written by Pete TerMaat and Roland Huebner.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
The full documentation for pr is maintained as a Texinfo manual. If the info and pr programs are properly installed at your site, the com-
mand
info pr
should give you access to the complete manual.
pr (coreutils) 4.5.3 February 2003 PR(1)