I have a situation where I am reading a text file line-by-line. Those lines of data contain comma separated fields of data. However, each line can vary in the number of fields it can contain. What I need to do is parse apart each line and write each field of data found (left to right) into a file.... (7 Replies)
Kindly i want to concatenate every 12 lines ina file, using a comma separator between fields (each line)?
can anyone help please?
thanks a lot in advance. (5 Replies)
hey guys!
i need to read data from a file that are comma separated then reorder them in another file to be generated
for example:
x,y,z
a,b,c
l,m,n
o,p,q
and transform this into:
x,a,l,o
y,b,m,p
z,c,n,q
Will appreciate your fast reply
Regards! (5 Replies)
I have a log file that contains several reports with following format.
<Start of delimiter> Report1 header
Report1 header continue
Report1 header continue
Record1 header
Record1 header continue
Record1 header continue
field1 field2 field3 field4
------... (1 Reply)
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below,... (8 Replies)
Hi All,
I am facing issue, to read words in line, line as follow and i want to read word at each comma
1,you,are,two
So i want read like
1
you
are
two
Thanks (1 Reply)
Hi,
I have a large number of files which are written as csv (comma-separated values).
Does anyone know of simple sed/awk command do achieve this?
Thanks!
---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ----------
Guess I asked this too soon. Found the... (0 Replies)
Hi Everyone,
On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
I am trying to change a file that looks like this:
file, announcement,date, server, server01, server02, server06, file04, rec01, rec04, rec03... etc
into a vertical file like this:
file
announcement
date
server
server01
server02
server06
The file does not have to be sorted... (5 Replies)
Hi Experts,
Please support
I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6.
... (3 Replies)
Discussion started by: as7951
3 Replies
LEARN ABOUT DEBIAN
freebsd-file2c
FILE2C(1) BSD General Commands Manual FILE2C(1)NAME
file2c -- convert file to c-source
SYNOPSIS
file2c [-sx] [-n count] [prefix [suffix]]
DESCRIPTION
The file2c utility reads a file from stdin and writes it to stdout, converting each byte to its decimal or hexadecimal representation on the
fly. The byte values are separated by a comma. This also means that the last byte value is not followed by a comma. By default the byte
values are printed in decimal, but when the -x option is given, the values will be printed in hexadecimal. When -s option is given, each
line is printed with a leading tab and each comma is followed by a space except for the last one on the line.
If more than 70 characters are printed on the same line, that line is ended and the output continues on the next line. With the -n option
this can be made to happen after the specified number of byte values have been printed. The length of the line will not be considered any-
more. To have all the byte values printed on the same line, give the -n option a negative number.
A prefix and suffix strings can be printed before and after the byte values (resp.) If a suffix is to be printed, a prefix must also be
specified. The first non-option word is the prefix, which may optionally be followed by a word that is to be used as the suffix.
This program is typically used to embed binary files into C source files. The prefix is used to define an array type and the suffix is used
to end the C statement. The -n, -s and -x options are useful when the binary data represents a bitmap and the output needs to remain read-
able and/or editable. Fonts, for example, are a good example of this.
EXAMPLES
The command:
date | file2c 'const char date[] = {' ',0};'
will produce:
const char date[] = {
83,97,116,32,74,97,110,32,50,56,32,49,54,58,50,56,58,48,53,
32,80,83,84,32,49,57,57,53,10
,0};
BSD March 22, 2007 BSD