Getting an unexpected newline in my while loop line-by-line feed
Hi,
I'm trying to get a line returned as is from the below input.csv file in Bash in Linux, and somehow I get an unexpected newline in the middle of my input.
Here's a sample line in input.csv
And here's a very basic while loop to read the contents of input.csv:
Here is the output:
I noticed that when I remove ' H' from the input (if the input.csv line reads
then the whole line gets printed fine. So there's something fishy with the ' H' format that's driving me nuts.
What tools can I use to accomplish this?
I'm writing a shell script to analyze an inittab file. Here's a sample file:
init:3:initdefault:
ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
tape::sysinit:/sbin/mtinit > /dev/console 2>&1
muxi::sysinit:/sbin/dasetup </dev/console >/dev/console... (10 Replies)
hi all,
i have csv file with three comma separated columns
i/p file
First_Name, Address, Last_Name
XXX, "456 New albany \n newyork, Unitedstates \n 45322-33", YYY\n
ZZZ, "654 rifle park \n toronto, canada \n 43L-w3b", RRR\n
is there any way i can remove \n (newline) from the second... (1 Reply)
Hi
I have a file with lots of line feeds and form feeds (page break). Need to replace last occurrence of form feed (created by - echo "\f" ) in the file with line feed.
Please advise how can i achieve this.
TIA
Prvn (5 Replies)
I have a file called test.dat which contains
a b
I have written a shell script called test.sh
for i in `cat test.dat`
do
echo $i
done
When i run this script using
sh test.sh
I get this message -
test.sh: syntax error at line 6: `end of file' unexpected
What is the... (3 Replies)
I am have an issue with the carrige or line feed chars showing up on info converted to a pdf file from a Orcale tool. Any direction would be appericated.
ex.
John doe 12435 1 232344 1
Jane doe 12435 1 424343 1
when should be like this
John doe... (1 Reply)
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Hi folks,
I did a search on this and didn't really find what fit my needs. I have a file with fixed record length of 436 bytes. I want to add a line feed x"0A" to the end x"0A" of each record(in byte 437). What's the easiest way to accomplish this?
Thanks. (5 Replies)
Hello all,
I have data like
"1"|"My_name"|"My_Email"|"My_Last"|My_other"
"2"|"My_name"|"My_Email"|"My_Last"|My_other"
"3"|"My_name"|"My_Email"|"
"|My_other"
"1"|"My_name"|"My_Email"|"My_Last"|My_other"
Need output like
"1"|"My_name"|"My_Email"|"My_Last"|My_other"... (10 Replies)
Hi! I have been struggling with a large file that has stray end of line characters.
I am working on a Mac (Lion). I mention this only because I have been mucking around with fixing my problem using sed, and I have learned far more than I wanted to know about Unix and Mac eol characters.
I... (1 Reply)
Please use code tags for sample data
Hi
I have a file where there are line feeds in the data. I am not able to read the file from an application. I exported this data from Access database and many columns contain line feed.
My data looks like this
abcd,efgh,ijkl,mnop
abcd,ef... (7 Replies)
Discussion started by: dnat
7 Replies
LEARN ABOUT REDHAT
pilot-addresses
pilot-addresses(1) General Commands Manual pilot-addresses(1)NAME
pilot-addresses - read and write address book databases to and from a Palm handheld device, such as those made from Palm, Handspring, Han-
dera, TRGPro, Sony or other Palm Compatible Handheld PDA device
SYNOPSIS
pilot-addresses -p <port> [-c category ] [-d category ] [-r file | -w file ]
(Note that some options are not shown above)
DESCRIPTION
pilot-addresses allows the user to read all entries in the Palm address book database, write new entries into the database, and delete a
category or delete all entries in the database.
TARGET DEVICE
The default serial device used to communicate with a Palm is /dev/pilot. If the environment variable $PILOTPORT is set, its value will
override the default. A serial device specified on the command-line will be used regardless of any $PILOTPORT setting.
OPTIONS
Several options exist, including...
-p --port <port>,
Use device file port to communicate with the Palm handheld device. If this is not specified, will look for the $PILOTPORT environ-
ment variable. If both are not found, will fall back to /dev/pilot.
-h --help
Display help synopsis for pilot-addresses
-v --version
Display version of pilot-addresses
-a Augments fields in address book records with additional information. The augmented information is placed before and separated from
the field with a semi-colon, (;).
Augmented information includes:
category_name - placed in front of each record or
["Work" | "Home" | "Fax" | "Other" | "E-mail" | "Main" | "Pager" | "Mobile" ] - placed in front of each phone number field.
Empty fields are not augmented.
-c category
Install records to category category by default. Normally pilot-addresses uses Unfiled as the default category. This option is over-
ridden by the category specified in the record with the -a option.
-d category
Delete all records in the specified category before installing new records.
-D Delete all address book records in all categories. Obviously, be very careful with this one.
-e Escape all special characters with a backslash. This enables you to read and write entries with newline characters in a field or
note.
-q Causes pilot-addresses to be quiet and not prompt you to press the HotSync button.
-r file
Reads records from file and install them to the Palm address book database. (Use the -w file to get a template file for input
records.)
-t delim
Include category in each record, use the delimiter specified to separate all fields of a record. Delimiters are specified as fol-
lows: 3=tab, 2=;, 1=,. This overrides the default delimiter of comma between fields and semi-colon between a field's augmented
information. (Please note that this may generate confusing results when used with the -a option.)
-T Write a header line with field titles as the first line of the data file.
-w file
Get all address book records from the Palm address book database and writes them into file
USAGE
The program will connect to a target device and port, prompt the user to HotSync, and perform the requested read or write operation speci-
fied by the user.
EXAMPLES
To write all address records in a Palm to the file addrbook.csv:
pilot-addresses -w addrbook.csv
or
pilot-addresses -p /dev/irnine -w addrbook.csv
To read the address book records in the file addrbook.csv and install them on a Palm:
pilot-addresses -r addrbook.csv
To read the address book records in the file addrbook.csv and place them into the Palm address book database category Special after first
deleting all current records in the Special category on the palm:
pilot-addresses -c Special -d Special -r addrbook.csv
SEE ALSO pilot-link(7)KNOWN BUGS
pilot-addresses has no known bugs.
REPORTING BUGS
Report bugs at http://bugs.pilot-link.org/
AUTHOR
pilot-addresses originally written by Kenneth Albanowski, manual page was written by Robert Wittig <bob.wittig@gt.org>.
Free Software Foundation Palm Computing Device Tools pilot-addresses(1)