10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I've data like these:
Gene1,Gene2 snp1
Gene3 snp2
Gene4 snp3
I'd like to split line if comma and then print remaining information for the respective gene.
My code:
awk '{
if($1 ~ /,/){
n = split($0, t, ",") (7 Replies)
Discussion started by: genome
7 Replies
2. Shell Programming and Scripting
Hello Folks,
Need to bisect strings based on a subset.
Below works good.
echo /a/b/c/d | awk -F"/c/d$" '{print $1}'
/a/b
However, it goes awry with special characters.
echo /a/b/c+/d | awk -F"/c+/d$" '{print $1}'
/a/b/c+/d
Desired output:
/a/b
Escaping the special characters... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies
3. Shell Programming and Scripting
This is really frustrating because I can't figure it out.
I'm running a health check script. One of the items I'm checking is the amount of memory on a server. I use the free command, which outputs something like this (excerpt)
Mem: 100 100 100 100
Swap: 100 100 100 100
In my debugging... (5 Replies)
Discussion started by: JustaDude
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a .csv file which as empty lines with comma and some special characters in 3rd column as below.
Source data
1,2,3,4,%#,6
,,,,,,
1,2,3,4,5,6
Target Data
1,2,3,4,5,6I need to remove blank lines and special charcters
I am trying to get this using the below awk
awk -F","... (2 Replies)
Discussion started by: shruthidwh
2 Replies
5. Shell Programming and Scripting
Hi everybody;
I have a code and this fetches data from first.txt,modify it and outputs it to second.txt file.
l awk 'NR>1 {print "l ./gcsw "$1" lt all lset Data="$2" Value "$3}' /home/gcsw/first.txt > /home/gcsw/second.txt
this outputs as:
l ./gcsw 123 lt all lset Data=456 Value 789
... (1 Reply)
Discussion started by: gc_sw
1 Replies
6. Shell Programming and Scripting
I'm using awk '{print $1}' and it works most of the time to print the contents of a mysql query loop, but occationally I get a field with some special character in it, is there a way to tell awk to ignore all special characters between my FS? I have >186K records, so building a list of ALL special... (6 Replies)
Discussion started by: unclecameron
6 Replies
7. Shell Programming and Scripting
Hi,
Here is my piece of code--
sub per_user_qna_detail
{
for($index=0;$index<@records;$index++)
{
if($records =~ m/^(.*)\s*Morocco.*Entering\s*Module::authenticate/)
{
printf "INSIDE per_user_qna_detail on LINE NO $index\n";
$Time_Stamp = $1;... (0 Replies)
Discussion started by: namishtiwari
0 Replies
8. Shell Programming and Scripting
Hi,
I have an application.xml file like
</dependency>
<artifactId>_AdminServicesEAR</artifactId>
<version>1.0.0-20080521.085352-1</version>
<context-root>oldvalue</context-root>
<type>ear</type>
<DOCTYPE "abc/xyz/eft">
<NewTag>value123</xyz>
... (4 Replies)
Discussion started by: subin_bala
4 Replies
9. UNIX for Advanced & Expert Users
Hello everyone,
I use Samba to copy mp3 files to my Red Hat 8.0 box so I can randomize them through a playlist. When I copy:
Sigur Rós-Nýja Lagið.mp3
It shows in the mapped drive on Windows as:
Sigur Rós-N_ja Lagi_.mp3
And via Putty as:
Sigur R(grayed box)s-N_ja Lagi_.mp3
What is going... (1 Reply)
Discussion started by: effigy
1 Replies
10. Shell Programming and Scripting
i have this script that searches for a pattern.
However it fails if the pattern includes some
special characters. So far, it fails with the
following strings:
1. -Cr
2. $Mj
3. H'412
would a sed or awk be more effective?
i don't want the users to put the (\)
during the search (they... (5 Replies)
Discussion started by: apalex
5 Replies