Shell script to split data with a delimiter having chars and special chars
Hi Team,
I have a file a1.txt with data as follows.
The delimiter string:
The above command is not working if we have multiple chars + special chars as delimiter.
Expected output is as follows.
Can anyone please me to fix this issue?
Thanks
Krishna
Moderator's Comments:
Please, please, USE CODE TAGS !!!
Last edited by Scrutinizer; 08-23-2019 at 05:16 PM..
Reason: code tags !
Hi,
One of our application is producing log files. But if we open the log file in vi or less or view mode, it shows all the special characters in it. The 'cat' shows correctly but it shows only last page. If I do 'cat' <file_name> | more, then again it shows special characters.
... (1 Reply)
Hi,
I need some advise on treating non printable chars over ascii value 126
Case 1 :
On some fields in the text , I need to retiain then 'as-is' and load to a database.I understand it also depends on database codepage.
but i just wanna know how do i ensure it do not change while loading... (1 Reply)
here is my simple script to show process and owners except me:
ps `-ef |grep xterm |grep -v aucar` | while read a1 a2 a3 a4 a5 a6 a7 a8
do
echo KILL..\($a1\).. $a2 |more
done
how can I pass values from command "ps -ef |grep xterm|grep -v aucar" to ?
because above command... (2 Replies)
I was using the following bash command inside the emacs compile command to search C++ source code:
grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d'
Emacs will then position me in the correct file and at the correct line... (0 Replies)
I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :(
I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
I was trying to run a code to check if a fax number is empty or not.
for that, I've written the following code which is throwing an error.
#!/bin/ksh
fax= "999-999-9999"
if ; then
fax_no="000-000-0000"
else
fax_no=$fax
fi
echo $fax_no
And I get the... (7 Replies)
I have a file with multiple lines. From each line I want to get all strings that starts with '+' and ends with '/'. Then I want the strings to be separated by ' + '
Example input:
+$A$/NOUN+At/NSUFF_FEM_PL+K/CASE_INDEF_ACC
Sample output:
$A$ + At + K (20 Replies)
Hi,
I have file
#cat drivers.txt
fcs0
fcs1
vscsi1
vscsi2
In this i need to check the availabality of "fcs" or "vscsi" alone not vscsi0,fcs1
I tried with "if condition" but it is not working.
cat drivers.txt| while read ADAP
do
echo "Checking for $ADAP"
if ;then
echo "FC... (9 Replies)
Hello guys,
I have a problem where I need to add a delimiter, that can be | for example, after each 28000 chars.
The problem is that sometimes 1 row, which should contain 28000 chars is split in 2, so I want to put the delimiter after each 28000 so I will know the end of each row.
Please... (2 Replies)
Hi,
I need all your help to achieve the below functionality.
I have a big 2 GB file and inside the file we need to identify, whether having a comma(,) or pipe(|) or tab or fixed position or semicolon(;) delimiter. If any of those delimiter found need to replace the file with pipe(|)... (1 Reply)
Discussion started by: lkeswar
1 Replies
LEARN ABOUT DEBIAN
vt-is-utf8
VT-IS-UTF8(1) Linux User's Manual VT-IS-UTF8(1)NAME
vt-is-UTF8 - check whether current VT is in UTF8- or byte-mode.
SYNOPSIS
vt-is-UTF8 [-h|--help] [-V|--version] [-q|--quiet]
DESCRIPTION
vt-is-UTF8 checks whether the current VT is in UTF8 mode, by writing (and erasing afterwards) a 3-byte-long UTF8 sequence, and looking how
much chars where displayed by the console driver.
A message telling in which mode the console is is then written to stdout (except if the --quiet option was given).
If the --quiet option is not given, the value returned is 1 if an error occurs, else 0.
OPTIONS -h --help
display version number, a short help message and exit.
-V --version
display version number and exit.
-q --quiet
do not print on stdout in with mode we are, but return the state as exit-status 1 if in UTF8-mode, 0 if in byte-mode. In case of
error, 0 is returned and a message is displayed on stderr.
BUGS
The check should be done by directly asking the kernel, which is not possible as of kernels 2.0.x.
As of kernel 2.0.35, the byte-mode is sometimes erroneously detected as UTF8-mode, after switching from a 512-chars font to a 256-chars
font. This is probably a console-driver bug.
SEE ALSO unicode_start(1), unicode_stop(1).
Console tools 10 Aug 1998 VT-IS-UTF8(1)