LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2016, 04:29 PM   #1
webodin
LQ Newbie
 
Registered: Mar 2016
Posts: 8

Rep: Reputation: Disabled
Question how to import text out of .txt file and put/sort them in a libre office tables?


How do i import text bellow from text file (large .txt file) and
sort to libreoffice or comma separate file,
is there any way to do it ? or simple script or example?

_________________________________________
235603: ** vpbx001
** REPORT : CTID=002, NAME=customer1 **

errorcount,barrier,limit
0,1.7,2.7
0,1.7,2.7

== END ==
________________________________________
** REPORT : CTID=003, NAME=customer2 **

errorcount,barrier,limit
0,17.2,27.0
PROBLEM: 2255726,17.2,27.0

== END ==
________________________________________
235603: ** vpbx3
** REPORT : CTID=18, NAME=customer3 **

errorcount,barrier,limit
0,1.7,2.7
PROBLEM: 1,1.7,2.7

== END ==
________________________________________
** REPORT : CTID=82, NAME=customer4 **
** REPORT : CTID=25, NAME=customer5 **

errorcount,barrier,limit
0,1.7,2.7
0,1.7,2.7

== END ==
__________________________________________
errorcount,barrier,limit
0,1.7,2.7
0,1.7,2.7

== END ==
_______________________________________
235603: ** vpbx14
235603: ** vpbx18
** REPORT : CTID=47, NAME=customer6 **

** REPORT : CTID=30, NAME=cutomer7 **

errorcount,barrier,limit
0,1.7,2.7
0,1.7,2.7

== END ==
________________________________________
** REPORT : CTID=15, NAME=customer8 **

errorcount,barrier,limit
0,1.7,2.7
PROBLEM: 289,1.7,2.7

== END ==
________________________________________
errorcount,barrier,limit
0,1.7,2.7
problem 2500,1.7,2.7

== END ==
________________________________________
235603: ** vpbx12
** REPORT : CTID=81, NAME= **

errorcount,barrier,limit
0,1.7,2.7
PROBLEM: 111,1.7,2.7

== END ==
_________________________________________

the way the text could be imported and separate in libreoffice
tables like example below ....

vpbxXX | CTID=XX | NAME=XXXXX | 0,1.7,2.7 | PROBLEM: 289,1.7,2.7

do any sitting with already solution please help..

Last edited by webodin; 03-10-2016 at 04:33 PM. Reason: spelling
 
Old 03-10-2016, 05:46 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
A problem you are going to face is that your input data is not consistent i.e. the data placement is not exactly the same in each record.

For example:

Code:
_________________________________________
235603: ** vpbx14
235603: ** vpbx18
** REPORT : CTID=47, NAME=customer6 **

** REPORT : CTID=30, NAME=cutomer7 **
at the start of one record, and

Code:
__________________________________________
errorcount,barrier,limit
0,1.7,2.7
0,1.7,2.7
at another are completely different.

You are either going to have to get your input data consistent (by perhaps changing the report generator) to make things easier, or take account of all the variances in the programming language, e.g. Python, that you use.
 
Old 03-11-2016, 04:27 AM   #3
webodin
LQ Newbie
 
Registered: Mar 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
how it will "vzubc" command look like
if i wanna read "CT" "tcp*" and FAIL

----------------------------------------------------------------
CT XXX | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL
-------------+---------------+---------------+-----+-----+------
kmemsize|16.6M 34% 31%|36.1M 75% 68%|47.7M|52.5M| -
lockedpages| - - - | - - - | 8M| 8M| -
privvmpages| 953M 46% 43%|1.26G 63% 59%| 2G|2.12G| -
shmpages| 4K - - | 8K - - | 84M| 84M| -
numproc| 108 5% 5%| 270 13% 13%| 2K| 2K| -
physpages| 644M - - |1.01G - - | - | - | -
vmguarpages| - - - | - - - | 132M| - | -
oomguarpages| 442M 433% - | 491M 482% - | 102M| - | -
numtcpsock| 123 12% 12%| 169 16% 16%| 1K| 1K| -
numflock| 6 3% 2%| 14 7% 6%| 188 | 206 | -
numpty| 2 12% 12%| 3 18% 18%| 16 | 16 | -
numsiginfo| 1 0.4% 0.4%| 39 15% 15%| 256 | 256 | -
tcpsndbuf| 718K 42% 27%|1.32M 80% 51%|1.64M|2.58M| -
tcprcvbuf| 208K 12% 7%|1.65M 100% 63%|1.64M|2.58M| 29

othersockbuf|54.2K 0.6% 0.5%| 865K 8% 8%|9.54M|10.5M| -
dgramrcvbuf| - - - | 161K 1% 1%| 16M| 16M| -
numothersock| 70 2% 2%| 213 5% 5%| 4K| 4K| -
dcachesize|5.99M 62% 31%|19.1M 200% 100%|9.54M|19.1M| -
numfile|1.19K 2% 2%|2.15K 3% 3%| 64K| 64K| -
numiptent| 4 3% 3%| 4 3% 3%| 128 | 128 | -
 
Old 03-11-2016, 05:30 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Please use [code][/code] tags when showing code or data.

I am not sure how your latest post and the first one are related?
I can tell you that if the last post with pipe separated data is what you have then you should be able to simply import and then remove the unwanted columns.
 
Old 03-11-2016, 06:00 AM   #5
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
It looks as though the OP is trying to gather information from an OpenVZ setup.
Rather than scripting to transform the output, perhaps the OP would do better to get the information out in the desired format. This script may provide some ideas. https://openvz.org/UBC_failcnt_reset...ve_bash_script
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
libre office writer table 4.2.7.2 build 2 hilight text to change font or move & page 1sweetwater! Linux - Software 0 12-05-2014 05:44 AM
[SOLVED] How to import .txt file into sqlite3 database using C API? Newbie89 Linux - Newbie 3 05-06-2013 04:32 AM
Libre office writer has canceled the contents of a file without asking it Bianchina Linux - Newbie 2 05-04-2012 08:40 PM
printing document comments on same page with text Libre/Open-Office SaintDanBert Linux - Software 4 11-15-2011 04:10 PM
how to sort this .txt file cliffyao Linux - Newbie 6 03-22-2010 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration