locked
Import CSV with 1400+ fields RRS feed

  • Question

  • Hi

    I'm trying to import a csv file with over 1400 headers (actually there are no headers, so I need to create them). So far, I've been able to do this, but I would have to write -headers 1,2,3.....1400.

    Is there an easier way to write the column names rather than type all 1400+

    My ultimate goal is to separate this file into several so that MS Access can import them (255 field limit)

    Thanks!

    • Moved by Bill_Stewart Monday, May 18, 2015 5:05 PM Poor quality question/shows no research effort
    Friday, January 16, 2015 10:50 AM

Answers

  • Import-Csv C:\somedir\filename.csv -Header (1..1400)


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    • Proposed as answer by jrv Friday, January 16, 2015 11:55 AM
    • Marked as answer by Just Karl Wednesday, May 20, 2015 8:25 PM
    Friday, January 16, 2015 11:34 AM