Ask Your Question
0

Calc import CSV file with weekly data every fifth row to monthly

asked 2019-07-03 19:02:00 +0200

benchrest gravatar image

I could do this manually but would have some 400 entries to create. I have a CSV file from FRED that has weekly data. I want to import only the first entry for a month to put the data along side another file of data that is monthly. the first row is IC4WSAmax.csv'#$IC4WSAmax.B781 and I would like the second column to be IC4WSAmax.csv'#$IC4WSAmax.B786. I have tried adding to the (B781+5) but that doesn't work.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-07-08 21:07:18 +0200

erAck gravatar image

If "monthly" indeed is every 5th row then create a helper column (e.g. in column C) beside the data with formula=MOD(ROW();5) and copy that formula down. Then use StandardFilter to filter on 0 and output the filtered result as copy to a different location.

Easier would be to do that on the command line using the awk interpreter with

awk '{if(NR%5==1){print}}' FRED.CSV >filtered.csv

and import filtered.csv to Calc.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-07-03 19:02:00 +0200

Seen: 23 times

Last updated: Jul 08