Your file is not ASCII at all but 16-bit Unicode, and as I suspected (but you refused to say) must have come from a Windows system. I guess your version of vi either detected and converted it, or stripped out all the nulls before displaying...
Use iconv to convert it into something your UNIX utilities can understand.
Code:
iconv -f UTF16LE -t UTF8 < inputfile | awk ...
Last edited by Corona688; 01-24-2014 at 01:34 PM..
Reason: iconv, not iconf
dear
i have one file regarding
>abshabja>sdksjbs>sknakna>snajxcls
so i want to be output like
>abshabja
>sjkabjb
>sknakna
>snajxcls
Any using awk or sed will help
thanks (2 Replies)
Hi Gurus,
I have a file which has some fields separated with multiple spaces or single space.
data
1 2 3 4 5 6
4 5 5 7 7 8 9
4 6 10
and so on.....
The problem I am facing is the output of the awk program... (2 Replies)
Please find the input file as given below:
2012/02/29 11:00:00~~CRITICAL~For customer 00000476 no daily files were found in the 010137933 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05006802 no daily files were found in the 010115166 account directory.
2012/02/29... (0 Replies)
Hi ,
I have the below ouput,
=====gopi=====
assasassaa
adsadsadsdsada
asdsadsadasdsa
sadasdsadsd
=====kannan===
asdasdasd
sadasddsaasd
adasdd
=====hbk===
asasasssa
....
..
I want the output like as below, not able paste here correctly. (2 Replies)
We have the following output:
server1_J00_data_20120711122243
server1_J00_igs_20120711122243
server1_J00_j2ee_20120711122243
server1_J00_sec_20120711122243
server1_J00_data_20120711131819
server1_J00_igs_20120711131819
server1_J00_j2ee_20120711131819
server2_J00_data_20120711122245... (10 Replies)
Hi Friends,
I am using a command that prints certain lines from a file.
For ex:
cat input
abc chr1 456
def chr1 789
ghi chr1 999
jjj chr1 777
jhk chr7 914
My command
awk '{if($2=="chr1" && $3>=456 && $3<=999) {print $0}}' OFS="\t" input
Output being printed is
abc chr1 456 (7 Replies)
Hi ,
I am trying to filter out the below output of fdisk -l command :
fdisk -l
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 ... (9 Replies)
I have a file of 100,000 lines in the below format:
answer.bed
chr1 957570 957852
NOC2L
chr1 976034 976270
PERM1
chr1 976542 976787
PERM1
I need to get each on one line and so far what I have tried doesn't seem to be working. Thank you... (3 Replies)
HEXDUMP(9) BSD Kernel Developer's Manual HEXDUMP(9)NAME
hexdump -- dump a block of bytes to the console in hexadecimal form
SYNOPSIS
#include <sys/systm.h>
void
hexdump(void *ptr, int length, const char *hdr, int flags);
DESCRIPTION
The hexdump() function prints an array of bytes to the console in hexadecimal form, along with the ASCII representation of the bytes, if pos-
sible. By default, each line of output will start with an offset count, followed by 16 hexadecimal values, followed by 16 ASCII characters.
ptr Pointer to the array of bytes to print. It does not need to be NUL-terminated.
length Number of bytes to print.
hdr Pointer to a NUL-terminated character string that will be prepended to each line of output. A value of NULL implies that no header
will be printed.
flags Flags for controlling the formatting of the output.
Bits 0-7 Integer value of the number of bytes to display on each line. A value of 0 implies that the default value of 16 will
be used.
Bits 8-15 Character ASCII value to use as the separator for the hexadecimal output. A value of 0 implies that the default value
of 32 (ASCII space) will be used.
HD_OMIT_COUNT Do not print the offset column at the beginning of each line.
HD_OMIT_HEX Do not print the hexadecimal values on each line.
HD_OMIT_CHARS Do not print the character values on each line.
SEE ALSO ascii(7)AUTHORS
This manual page was written by Scott Long.
BSD December 7, 2003 BSD