nambah kolom dengan awk

Tips and Tricks around GNU/Linux and Open Source Applications

Moderator: Moderators

oblivian
New Member
New Member
Posts: 6
Joined: Thu Jun 20, 2013 2:34 pm

nambah kolom dengan awk

Postby oblivian » Fri Jan 09, 2015 10:34 am

master dan para suhu..ane mau tanya.

Gimana caranya nge delete baris dalam file seperti contoh berikut :

# DEPTH (Z, TVD) GIVEN IN m-UNITS
# ANGLES ARE NOT EXACT (TRACE WAS NOT IMPORTED USING ANGLES)
#====================================================================================================================
0.0000000000 540336.78000 9883869.0500 20.000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
20.000000000 540336.78000 9883869.0500 0.0000000000 20.000000000 0.0000000000 0.0000000000 339.00014545 0.0900000394 0.1350000650
545.09997559 540336.48441 9883869.8200 -525.0991211 545.09912109 -0.295588821 0.7700410485 302.77015107 0.2128508165 0.0085698180
# DEPTH (Z, TVD) GIVEN IN m-UNITS
# ANGLES ARE NOT EXACT (TRACE WAS NOT IMPORTED USING ANGLES)
#====================================================================================================================
0.0000000000 540336.78000 9883869.0500 20.000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
20.000000000 540336.78000 9883869.0500 0.0000000000 20.000000000 0.0000000000 0.0000000000 339.00014545 0.0900000394 0.1350000650
545.09997559 540336.48441 9883869.8200 -525.0991211 545.09912109 -0.295588821 0.7700410485 302.77015107 0.2128508165 0.0085698180
20.000000000 540336.78000 9883869.0500 0.0000000000 20.000000000 0.0000000000 0.0000000000 339.00014545 0.0900000394 0.1350000650

Gimana caranya ngilangin baris yang ada tanda "#". Dan file seperti ini ada sekitar 2000 file. Jadi ane butuh script yang bisa ngilangin baris yang ada tanda "#" karena ane cuma butuhin angka2nya saja.
Dan gimana juga caranya nambah kolom di samping kolom angka2 tsb.

Terima kasih sebelumnya....

User avatar
malsasa
Starting Member
Starting Member
Posts: 65
Joined: Wed Apr 18, 2012 4:49 pm
Location: Mojokerto
Contact:

Re: nambah kolom dengan awk

Postby malsasa » Thu Feb 05, 2015 10:41 am

Maaf kurang membantu. Saya hanya punya buku awk, di sini: http://bengkelubuntu.org/teks/awk/.
Blog: http://malsasa.wordpress.com (panduan Ubuntu untuk pemula)
Website: http://bengkelubuntu.org (instal aplikasi offline Ubuntu)
IRC: #ubuntu-indonesia @ freenode.net

lidyawang
New Member
New Member
Posts: 1
Joined: Fri Sep 18, 2015 5:49 pm

Re: nambah kolom dengan awk

Postby lidyawang » Fri Sep 18, 2015 6:01 pm

thank you bro Malsasa, paling gak udah bisa membantu yg newbie ini sedikit hahaha



Visit Us
Agen Bola Online Terpercaya

User avatar
crazynuxer
Advanced Member
Advanced Member
Posts: 1293
Joined: Fri Sep 01, 2006 3:13 pm
Location: Jakarta Selatan
Contact:

Re: nambah kolom dengan awk

Postby crazynuxer » Tue Nov 10, 2015 11:11 pm

kalau menghilangkan baris bisa dengan perintah grep -v

Code: Select all

grep -v "#" file.txt
kesempurnaan dibentuk dari hal yg kecil tapi kesempurnaan bukan lah hal yg kecil


Return to “Tips and Trick”

Who is online

Users browsing this forum: No registered users and 1 guest