Hi, I want to read lines from a file, and I'm using two methods
1 use
2 use
however, in both of them, I notice that the tab between fields are automatically converted to space
because I want to use awk over the lines, I hope the 'tab' can be kept
are there any ways? thanks
I'm reading from a file that is semi-colon delimited. One of the fields contains 2 spaces separating the first and last name (4th field in - "JOHN<space><space> DOE"):
e.g. TORONTO;ONTARIO;1 YONGE STREET;JOHN DOE;CANADA
When I read this record and either echo/print to screen or write to... (4 Replies)
i have a commad that display the total each directory size in KB.Below the commad and o/p:
ls -ltr | grep ^d | awk '{print $9}' | xargs du -sk
output:
what i want is the proper tab space b/w value and dir.? how to get that.
thanks in advance (10 Replies)
Wants to print line when there exist leading or trailing space or tab in fields 2,3 and 5
The below code prints all lines in file even if they dont have leading and trailing space or tab.
nawk -F"|" '{for(i=1;i<=NF;i++) {if ($i ~ "^*" || $i ~ "*$")}}1' file
file
Ouput required:
... (5 Replies)
Hi,
So my file looks like this:
title number
JR 2
JR 2
JR 4
JR 5
NM 5
NM 8
NM 2
NM 8
I used this line that I wrote to convert it to rows so it will look like this:
awk -F"\t" '!/^$/{a=a" "$3} END {for ( i in a) {print i,a}}' occ_output.tab > test.txt
JR 2 2 4 5
NM 5 8... (4 Replies)
Hello,
Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another.
Thanks,
G (4 Replies)
Hi,
I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
I have a variable sumOfJEOutputFile which is the output file of an SQL command which contains the output of that SQL. The output looks like below:
-----------
58
I am using following code to manipulate the output:
(sed 1,2d $sumOfJEOutputFile > $newTemp1 | sed '$d' $newTemp1)... (4 Replies)
My file looks like
3 33 210.01.10.0 2.1 1211 560 26 45 1298 98763451112 15412323499 INPUT OK
3 233 40.01.10.0 2.1 1451 780 54 99 1876 78787878784 15423210199 CANCEL OK
Aim is to replace the spaces in each line by tab
Used: sed -e 's/ */\t/g'
But I get output like this... (3 Replies)
Discussion started by: sa@@
3 Replies
LEARN ABOUT DEBIAN
plan9-cat
CAT(1) General Commands Manual CAT(1)NAME
cat, read, nobs - catenate files
SYNOPSIS
cat [ file ... ]
read [ -m ] [ -n nline ] [ file ... ]
nobs [ file ... ]
DESCRIPTION
Cat reads each file in sequence and writes it on the standard output. Thus
cat file
prints a file and
cat file1 file2 >file3
concatenates the first two files and places the result on the third.
If no file is given, cat reads from the standard input. Output is buffered in blocks matching the input.
Read copies to standard output exactly one line from the named file, default standard input. It is useful in interactive rc(1) scripts.
The -m flag causes it to continue reading and writing multiple lines until end of file; -n causes it to read no more than nline lines.
Read always executes a single write for each line of input, which can be helpful when preparing input to programs that expect line-at-a-
time data. It never reads any more data from the input than it prints to the output.
Nobs copies the named files to standard output except that it removes all backspace characters and the characters that precede them. It is
useful to use as $PAGER with the Unix version of man(1) when run inside a win (see acme(1)) window.
SOURCE
/src/cmd/cat.c
/src/cmd/read.c
/bin/nobs
SEE ALSO cp(1)DIAGNOSTICS
Read exits with status eof on end of file or, in the -n case, if it doesn't read nlines lines.
BUGS
Beware of and which destroy input files before reading them.
CAT(1)