How can I pull data from a txt file using UltraEdit?

How can I pull data from a txt file using UltraEdit?

1
NewbieNewbie
1

    16:15 - 7 days ago#1

    I have a text file and like to pull data from the 001 line and 245 $a into an Excel spreadsheet. Here are some lines of the content in the text file:

    Code: Select all

    1. LEADER 00961cas  2200277Mi 4500
    001 ocn900971555
    003 OCoLC
    005 20230816213017.0
    008 150129uuuuuuuuugw uu         0   u0ger d
    022   $a0003-2417
    035   $a(OCoLC)900971555
    245 04$aDer Anaesthesist.
    260   $aBerlin.
    * Bib record has no holdings attached
    Note: ePeriodical record
    
    
    2. LEADER 01912cas  2200457 a 4500
    001 ocn654096074
    003 OCoLC
    005 20230816213017.0
    008 100809c20119999utufr p       0   a0eng  
    022 0 $a2156-8022$21
    035   $a(OCoLC)654096074
    245 00$aMormon studies review.
    260   $aProvo, Utah :$bNeal A. Maxwell Institute for Religious Scholarship
    * Bib record has no holdings attached
    Note: ePeriodical record
    
    
    3. LEADER 01734cas  2200469M  4500
    001 ocn191713374
    003 OCoLC
    005 20230816213017.0
    007 ta
    008 791207c19uu9999enkuu p       0    0eng d
    022   $a0307-3378$l0307-3378
    035   $a(OCoLC)191713374$z(OCoLC)499389079$z(OCoLC)972873280$z(OCoLC)978023747$z(OCoLC)1063404887
    245 00$aBulletin of economic research.
    260   $a[Heslington, Eng.]$bDepartments of Economics of the Universities of Hull, Leeds, Sheffield, York, and Bradford.
    300   $avolumes
    * Bib record has no holdings attached
    Note: ePeriodical record
    
    
    
    4. LEADER 03303cas  2200589Mi 4500
    001 on1196223052
    003 OCoLC
    005 20230816213017.0
    008 850920c18239999enkwr p       0   a0eng d
    022   $a0140-6736$z0023-7507$y0099-5355 (Print)
    022   $a1474-547X (Digital)
    035   $a(OCoLC)1196223052
    245 10$aLancet.
    260   $aLondon :$bThe Lancet Limited,$c1823-
    300   $avolumes :$billustrations ;$c22-28 cm
    * Bib record has no holdings attached
    Note: ePeriodical record
    Does anyone who can share your experience?
    Thank you!
     
    testUltraEdit.txt (13.44 KiB)   0

    Mofi
    6,572524
    Grand MasterGrand Master
    6,572524

      17:33 - 7 days ago#2

      UltraEdit is a text editor. It does not support the binary Excel file formats with file extension .xls or .xlsx.

      It is of course possible to run a Find with the advanced option List lines containing string  with the UltraEdit regular expression %^{001^}^{245^} or the Unix regular expression ^(001|245) or Perl regular expression ^(?:001|245) and right click next in the opened Find String List window and click in the context menu on Copy results to new file and save the file with file extension .csv.

      A Find in Files in Open files with just this file opened with Results to edit window with one of the three regular expressions is also possible and the results file is saved next with file extension .csv. There should be configured in this case at Advanced - Settings or Configuration - Search - Find output format the wanted output format which is in this case unchecked Header, File summary, Find summary and still checked Found line is modified from $P($L): $S to just $S.

      There can be used the UltraEdit script FindStringsToNewFile.js.

      Or there is UltraEdit not used at all and instead executed in a command prompt window:

      Code: Select all

      findstr /B "001 245" "C:\Path\testUltraEdit.txt" >Result.csv
      You must also post the expected output If the CSV file should contain something other than just the lines beginning with 001 or 245.
      Best regards from an UC/UE/UES for Windows user from Austria