onlyf

1

votes
1

answer
6.5k

views

Python - Pandas delete specific rows/columns in excel

i have the following excel file, and i would like to clean specific rows/columns so that i can further process the file. I have tried this, but i have not managed to remove any of the blank lines, i ve only managed to trim from those containing data. Here, i was trying to only save the data from the...
onlyf
1

votes
1

answer
59

views

Run cmd command with hidden command window

i've written a simple function to output a value of a specific textbox in Access 2010 to a textfile Private Sub ProcessButton_Click() MsgBox ('Into Process Button Click') ' Assign found line to variable Dim Outline As String Outline = Me.TextboxFound.Value 'Save record to file strFile_Path = OutputF...
onlyf
1

votes
1

answer
340

views

Changing the prefix of a file with sed

I would like some advice on this script. I'm trying to use sed (I didn't manage it with rename) to change a file that contains lines of the format (my test file name is sedtest): COPY W:\Interfaces\Payments\Tameia\Unprocessed\X151008\E*.* (that's not the only content of the file). My goal is to repl...
onlyf
1

votes
1

answer
327

views

Bash - cut a text file into columns, slice strings and store value into arrays

I would like some advice on some code. I want to write a small script that will take an input file of this format $cat filename.txt 111222233334444555666661112222AAAA 2222333445556612323244455445454545 2334556345643534505435345353453453 (and so on) It will be called as : script inputfile X (where X...
onlyf
1

votes
1

answer
51

views

Remove duplicates based on substring in Python

i have the following code for detecting duplicates in a file and outputing them in 3 separate files, one for non-duplicates, one for duplicates (x2) and one for duplicates (> x2). The first file, holds only lines that had no duplicates in the original file. (It doesnt remove any duplicate lines foun...
onlyf
1

votes
1

answer
54

views

Perl - Scan directory for pattern in contained filenames and fill array

i ve tried to write a simple function that takes two arguments, input directory and pattern, and returns an array with the matched files that contain the pattern(s) in their name. my $dir = '/drives/D/Desktop/perlscripts'; sub getfiles { my ($dirName, @patterns) = @_; opendir(my $dir, $dirName) or d...
onlyf
1

votes
1

answer
47

views

Grabbing one character after the Nth pattern match - PERL

i have a sample file that is structured like below, and i would like to perform some operations on it : 1112283569;AOEEEEAOAO.;300012299419;0030000302;ALLE;0.00;0.00;0.00;0.00;79149449.66;0.00;7914944 1112283569;AOEEEEAOAO.;300012;;;;AAAAA299419;*;;0.00;0.00;0.00;0.00;79149449.66;0.00;79149449.6...
onlyf
1

votes
2

answer
826

views

SED with “unmatched /” and odd behavior

I have an input file that looks like this, and i was trying a couple transformations with sed : Original File : DATA: gt_alv LIKF zfica_paym_cancel_alv OCCURS 0 WITH HFADFR LINF. DATA: gt_out LIKF zfica_paym_cancel_out OCCURS 0 WITH HFADFR LINF. I want to clean some characters based on their hexade...
onlyf
1

votes
1

answer
972

views

Sed - Print Lines that match two patterns

i have the following problem. My file looks like this : 1082016051300000010005690902BCDEΔ0204366221002201612052016-00001274448A 1082016051300000010034397704EDFG10865125102001201626042016-000001028134 1082016051300000010068901401RA...
onlyf
1

votes
2

answer
99

views

sed - Changing pattern with specific number of digits

i m trying to perform a substitution on the following group of lines : 1AA20160817BBBBBDIGITS1NUMBER1STYLE59 00002200000220 1AA20160817BBBBBDIGITS2NUMBER1STYLE60 00000000000220 1AA20160817DDDDDDIGITS3NUMBER2STYLE60 00000000000486 1AA20160817DDDDDDIGITS4NUMBER2STYLE59 0000...
onlyf
1

votes
1

answer
744

views

Vbscript - Multiple lines on vbs script email

I use the following code to send automatic emails, passing a parameter in them : Const schema = 'http://schemas.microsoft.com/cdo/configuration/' Const cdoBasic = 2 Const cdoSendUsingPort = 2 Dim oMsg, oConf Dim sDateTimeStamp Set args = WScript.Arguments arg1 = args.Item(0) ' E-mail properties...
onlyf
1

votes
1

answer
589

views

awk multiple lines stored into variable

Goodday, I have a file in the following format : XXXXXXXXXXXYYYYYYYYAAAAAAAA XXXXXXXXXXXIIIIIIII22222222 XXXXXXXXXXXOOOOOOOOPPPPPPPP XXXXXXXXXXXAAAAAAAAKKKKKKKK YYYYYYYYYYY22222222AAAAAAAA YYYYYYYYYYY55555555BBBBBBBB YYYYYYYYYYYGGGGGGGGKKKKKKKK YYYYYYYYYYYQQQQQQQQ88888888 ... and so on. Every 4 line...
onlyf
1

votes
1

answer
854

views

Python - Pandas subtotals on groupby

here's a sample of the data i m using : SCENARIO DATE POD AREA IDOC STATUS TYPE AAA 02.06.2015 JKJKJKJKJKK 4210 713375 51 1 AAA 02.06.2015 JWERWERE 4210 713375 51 1 AAA 02.06.2015 JAFDFDFDFD 4210 713375 51 9 BBB 02.06.2015...
onlyf
1

votes
2

answer
231

views

Awk - Sum fields of specific lines based on susbtring

i have a file that looks like : 100001001 0 130 100001001 0 610 100001001 0 210 100001001 0 100 100001001 1 80 100001002 0 300 100001002 0 200 100001002 0 100 100001003 0 200 100001003 0 100 100001004 1 50 I would like to sum the third field for each same 1st field, and exclude the lines from this...
onlyf
2

votes
5

answer
1.1k

views

Counting number of character occurrences per line

I have a file that looks like this: ( Note : A*, B*, C* are placeholders). The file is delimited by ; AAAA;BBBB;CCCCCCCC;DD;EEEEEEEE;FF; AAA1;BBBBB;CCCC;DD;EEEEEEEE;FFFFF; AAA3;BB;CCCC;DDDDDDDDD;EEEEEEE;FF; I m trying to write a small script that counts the number of occurrences of the delimiter ; a...
onlyf
1

votes
3

answer
545

views

OpenSQL SELECT with substring in ON clause

I have the following select statement in ABAP: SELECT munic~mandt VREFER BIS AB ZZELECDATE ZZCERTDATE CONSYEAR ZDIMO ZZONE_M ZZONE_T USAGE_M USAGE_T M2MC M2MT M2RET EXEMPTMCMT EXEMPRET CHARGEMCMT INTO corresponding fields of table GT_INSTMUNIC_F FROM ZCI00_INSTMUNIC AS MUNIC INNER JOIN EVER AS EV on...
onlyf
1

votes
5

answer
55

views

Extracting numeric pattern from file line

I have a file that has the following format: EDouble entry for scenario XX AAA 70337262003 Line 000000003350 EDouble entry for scenario XX AAA 70337262003 Line 000000003347 EDouble entry for scenario XX AAA 71375201001 Line 000000003353 EDouble entry for scenario XX AAA 71375201001 Line 000000003351...
onlyf
1

votes
3

answer
505

views

Perl - Filter function for arrays

i am trying to create a subroutine that does the following : Takes two arrays as input (Filter, Base) Outputs only the values of the second array that do not exist in the first Example : @a = ( 1, 2, 3, 4, 5 ); @b = ( 1, 2, 3, 4, 5, 6, 7); Expected output : @c = ( 6, 7 ); Called as : filter_list(...
onlyf
1

votes
1

answer
94

views

c# - Text File to Dictionary

i want to turn a text file, into a dictionary of Lists. The dictionary is declared in its separate class, BaseDict, as : public static Dictionary myLists = new Dictionary(); The method that populates it is in a different class, and is the following : public void TextFileToDictionary2() { using (var...
onlyf
2

votes
1

answer
1k

views

Batch - Store output of dir command into variable - directory listing

I need to store an entire directory listing into a variable, then pass said variable as a parameter to another script. Either directly or by first storing the output of dir to a text file, then doing something like this : dir \path\todir > temp.txt set /p VAR=
onlyf
4

votes
1

answer
2.4k

views

Return code from shell script run from PuTTY to calling batch file?

I would like to ask a question about how to apply PuTTY and control its return values. My setup is like this. There's a xxxxx.bat file which contains PuTTY call with a ssh connection in the likes of: putty.ext ssh 10.10.10.10 -l xxxx -pw yyyy -t -m wintest.txt The file wintest.txt contains: echo 'wi...
onlyf
2

votes
1

answer
203

views

Pandas, value error

i have the following data in an excel: SCENARIO DATE POD AREA IDOC STATUS TYPE AAA 02.06.2015 JKJKJKJKJKK 4210 713375 51 1 AAA 02.06.2015 JWERWERE 4210 713375 51 1 AAA 02.06.2015 JAFDFDFDFD 4210 713375 51 9 BBB 02.06.2015...
onlyf
1

votes
1

answer
106

views

Perl : Counting Duplicates

I have the following file.txt : AAAA BBBB AAAA CCCC EEEE AAAA and i ve written a script to count the number of duplicates, sort them from highest duplicates to lowest and print them. Like : AAAA : 3 BBBB : 1 CCCC : 1 EEEE : 1 The script is : use v5.14; use strict; my %map; chomp(my @chks = ); foreac...
onlyf
1

votes
3

answer
1.4k

views

ABAP - Inner Join itab with db table

I have the following problem. I need to write a script that reads a specific file, from the presentation layer, containing one numerical string per line, the contents of this file need to be entered into an internal table, and then the internal table needs to be inner joined, with table dfkkop to p...
onlyf
2

votes
3

answer
93

views

Python : Count frequences in dictionary

i want to count the number of each value in a dictionary, and construct a new one with the value as the key, and a list of keys that had said value as the value. Input : b = {'a':3,'b':3,'c':8,'d':3,'e':8} Output: c = { '3':[a. b. d] '8':[c, e] } I ve written the following, but it raises a key erro...
onlyf
2

votes
1

answer
793

views

Bash - Remove duplicates preserve order [duplicate]

This question already has an answer here: How can I delete duplicate lines in a file in Unix? 8 answers i have a file that looks like 1254543534523233434 3453453454323233434 2342342343223233535 0909909092324243535 Is there a way / command in bash to remove duplicates on the file above, based on a s...
onlyf
1

votes
3

answer
678

views

Python - Performance when iterating over dictionary keys

i have a relatively large text file (around 7m lines) and i want to run a specific logic over it which i ll try to explain below: A1KEY1 A2KEY1 B1KEY2 C1KEY3 D1KEY3 E1KEY4 I want to count the frequency of appearence of the keys, and then output those with a frequency of 1 into one text file, those w...
onlyf
2

votes
2

answer
783

views

Batch - Parsing the output of Tracert

i would like to ask for some help with the output of tracert in windows, ie i have this output : Tracing route to Y.Y.Y.Y over a maximum of 30 hops 1 1 ms 1 ms 1 ms X.X.X.X 2 103 ms 71 ms 22 ms X.X.X.X 3 35 ms 51 ms 35 ms X.X.X.X .... and i would like to produce a...
onlyf
2

votes
5

answer
96

views

Transliterate Characters in Hex in Bash

i have a set of hexadecimals that i d like to transliterate to another set of hexadecimals, in example : x00 -> x20 xB0 -> x20 x21 -> x40 x80-xFF -> x20 x22 -> x43 I know i can chain sed statements like : sed -i.bak $'s/[\x80-\xFF]/\x20/g' or like : sed -e 's/\x00/\x20/g;s/\xB0/\x20/g' but is there...
onlyf