Search Results

Search found 12 results on 1 pages for 'richardh'.

Page 1/1 | 1 

  • Change YYYY-MM-DD to YYYYMMDD everywhere in file

    - by richardh
    I can't just delete all of the hyphens, because elsewhere they are used as minus signs. I can find these dates with [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} but I can't figure out how to keep those three different digit wildcards in memory. My attempts end up replacing the dates with the search string (e.g., :%s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/[0-9]\{4\}[0-9]\{2\}[0-9]\{2\}/g). Any ideas? If there's a command line solution, I'd love to learn that, too. Thanks!

    Read the article

  • How to add chrome bookmarks to Windows 7 favorites folder (where IE favorites live)

    - by richardh
    I just switched to Windows 7 and love the taskbar and library features. If I make a desktop shortcut to a webpage, then it becomes searchable from the taskbar (i.e., press the Win/meta key and type the shortcut's name and it pops up). The IE bookmarks/favorites already come with shortcuts in your "Favorites" folder. Can I programatically do this with my chrome shortcuts? My first thought was to export bookmarks to IE, but I can't find an option in IE that allows me to export bookmarks/favorites as shortcuts. Thanks!

    Read the article

  • Understanding !d command in sed with respect to saves

    - by richardh
    I have a directory of tab-delimited text files and some have comments in the first few lines that I would like to delete. I know that the first good line starts with "Mark" so I can use /^Mark/,$!d to delete these comments. After this deletion I have several other replacements that I make in the (new) first line that has variable names. My question is, why do I have to save sed's output to get my script to work? I understand that if I line is deleted, then the output doesn't proceed downstream because there is no output. But if I don't delete (i.e., !d) then why do I have to save to file? Thanks! Here is my shell script. (I'm a sed newbie, so any other feedback is also appreciated.) #!/bin/bash for file in *.txt; do mv $file $file.old1 sed -e '/^Mark/,$!d' $file.old1 > $file.old2 sed -e '1s/\([Ss]\)hareholder/\1hrhldr/g'\ -e '1s/\([Ii]\)mmediate/\1mmdt/g'\ -e '1s/\([Nn]\)umber/\1o/g'\ -e '1s/\([Cc]\)ompany/\1o/g'\ -e '1s/\([Ii]\)nformation/\1nfo/g'\ -e '1s/\([Pp]\)ercentage/\1ct/g'\ -e '1s/\([Dd]\)omestic/\1om/g'\ -e '1s/\([Gg]\)lobal/\1lbl/g'\ -e '1s/\([Cc]\)ountry/\1ntry/g'\ -e '1s/\([Ss]\)ource/\1rc/g'\ -e '1s/\([Oo]\)wnership/\1wnrshp/g'\ -e '1s/\([Uu]\)ltimate/\1ltmt/g'\ -e '1s/\([Ii]\)ncorporation/\1ncorp/g'\ -e '1s/\([Tt]\)otal/\1ot/g'\ -e '1s/\([Dd]\)irect/\1ir/g'\ $file.old2 > $file rm -f $file.old* done

    Read the article

  • Use argdo with search pattern to delete line while suppressing errors and requiring confirmation in Vim

    - by richardh
    I use gVim 7.3.46 on Win 7. It is pretty straightforward to use argdo to search args files for a pattern and replace it while suppressing errors and requiring confirmation. :argdo %s/pattern/replace/gec | update However, I would like to delete entire lines that contain the pattern. I use the following. :argdo %/pattern/d | update But I can't suppress errors or require confirmation. Is there a way to do this? Thanks! (Also, is there a way to set "more" off? Thanks!)

    Read the article

  • How to handle files that don't need version control in mercurial

    - by richardh
    I am new to mercurial, and for the most part do LaTeX reports and statistical calculations in R using .csv and/or .sqlite files. Re LaTeX, all I really care is the .tex file. Re R, I don't need version control on the .csv or .sqlite files because they are static. When I do 'hg add' for a repo with a .csv and/or .sqlite file, I get a warning like: rev2.sqlite: up to 3070 MB of RAM may be required to manage this file (use 'hg revert rev2.sqlite' to cancel pending addition) So I revert and subsequently use adds like hg add -X *.sqlite. I guess I really have two questions: (1) Should I ignore these warnings? Because these large files are static, can I just add to the repo knowing that the diff files will always be empty and not worry about wasted resources? (2) If I should keep excluding these files from the repo, is there away that I can fix this option? I.E., add to my .hgrc file something that always appends an option like -I *.tex -I *.R to my 'hg add' commands? Thanks!

    Read the article

  • Shortcut key for "Open file location" in Windows 7

    - by richardh
    I'm new to Windows (former Mac user) and using Windows 7 for about two months now. I almost exclusively use the taskbar to navigate to files (i.e., I press the Win/meta key and start typing... my libraries and naming conventions make it pretty easy to get the correct file). Then I press enter and the file opens. Awesome. But sometimes I want to see the file in its folder (i.e., maybe I want to rename, move, copy, etc.). To do this I need to mouse/trackpad over and right click to get the "Open in file location" options. Is there another way, short of searching for the folder name instead? Is there a hotkey/shortcut for "Open file location"? Thanks!

    Read the article

  • How to handle files that don't need version control in mercurial

    - by richardh
    I am new to mercurial, and for the most part do LaTeX reports and statistical calculations in R using .csv and/or .sqlite files. Re LaTeX, all I really care is the .tex file. Re R, I don't need version control on the .csv or .sqlite files because they are static. When I do 'hg add' for a repo with a .csv and/or .sqlite file, I get a warning like: rev2.sqlite: up to 3070 MB of RAM may be required to manage this file (use 'hg revert rev2.sqlite' to cancel pending addition) So I revert and subsequently use adds like hg add -X *.sqlite. I guess I really have two questions: (1) Should I ignore these warnings? Because these large files are static, can I just add to the repo knowing that the diff files will always be empty and not worry about wasted resources? (2) If I should keep excluding these files from the repo, is there away that I can fix this option? I.E., add to my .hgrc file something that always appends an option like -I *.tex -I *.R to my 'hg add' commands? Thanks!

    Read the article

  • Shortcut for "show in folder" in Windows 7

    - by richardh
    I'm new to Windows (former Mac user) and using Windows 7 for about two months now. I almost exclusively use the taskbar to navigate to files (i.e., I press the Win/meta key and start typing... my libraries and naming conventions make it pretty easy to get the correct file). Then I press enter and the file opens. Awesome. But sometimes I want to see the file in its folder (i.e., maybe I want to rename, move, copy, etc.). To do this I need to mouse/trackpad over and right click to get the "show in folder" options. Is there another way short of searching for the folder name instead? Is there a hotkey/shortcut for "show in folder"? Thanks!

    Read the article

  • Memory efficient import many data files into panda DataFrame in Python

    - by richardh
    I import into a panda DataFrame a directory of |-delimited.dat files. The following code works, but I eventually run out of RAM with a MemoryError:. import pandas as pd import glob temp = [] dataDir = 'C:/users/richard/research/data/edgar/masterfiles' for dataFile in glob.glob(dataDir + '/master_*.dat'): print dataFile temp.append(pd.read_table(dataFile, delimiter='|', header=0)) masterAll = pd.concat(temp) Is there a more memory efficient approach? Or should I go whole hog to a database? (I will move to a database eventually, but I am baby stepping my move to pandas.) Thanks! FWIW, here is the head of an example .dat file: cik|cname|ftype|date|fileloc 1000032|BINCH JAMES G|4|2011-03-08|edgar/data/1000032/0001181431-11-016512.txt 1000045|NICHOLAS FINANCIAL INC|10-Q|2011-02-11|edgar/data/1000045/0001193125-11-031933.txt 1000045|NICHOLAS FINANCIAL INC|8-K|2011-01-11|edgar/data/1000045/0001193125-11-005531.txt 1000045|NICHOLAS FINANCIAL INC|8-K|2011-01-27|edgar/data/1000045/0001193125-11-015631.txt 1000045|NICHOLAS FINANCIAL INC|SC 13G/A|2011-02-14|edgar/data/1000045/0000929638-11-00151.txt

    Read the article

  • Calculating a 12-month moving average of weekly series, but anchored at the last day of the month

    - by richardh
    I have a zoo object oi.zoo with weekly data. I would like to sooth this with a 12-month moving average (easy enough), but I can't figure out how to anchor the right edge of the the moving average window at the end of the month (to correspond with the on which factors I am regressing). For example: > head(oi.zoo) 1986-01-15 1986-01-31 1986-02-14 1986-02-28 1986-03-14 1986-03-31 2966182 2986748 2948045 2990979 2993453 2936038 > head(mkt) 1926-07-31 1926-08-31 1926-09-30 1926-10-31 1926-11-30 1926-12-31 2.62 2.56 0.36 -3.43 2.44 2.77 I have some other factors and plan on using dynlm to regress. Thanks!

    Read the article

  • Is there a work-around that allows missing data to equal NULL for LOAD DATA INFILE in MySQL?

    - by richardh
    I have a lot of large csv files with NULL values stored as ,, (i.e., no entry). After a lot of searching I found that this is a known "bug", although it may be a feature for some users. Is there a way that I can fix this on the fly without pre-processing? These data are all numeric, so a zero value is very different from NULL. Or if I have to do pre-processing, is there one that is most promising for dealing with tens of csv files of 100mb to 1gb? Thanks!

    Read the article

1